package demo.topic15;

interface ColorInfo{
    public String getColor();
}

/**
 * 枚举带构造函数
 * 枚举的本质：是一个继承了Enum类的子类，JVM编译器把枚举编译后生成一个final class
 */
public enum Color2 implements ColorInfo {
    RED("红色"),
    YELLOW("黄色"),
    GREEN("绿色");

    private String color;

    private Color2() {}

    private Color2(String color) {
        this.color = color;
    }

    @Override
    public String getColor() {
        return color;
    }
}
